import request from '@/utils/request'

const api = {
  franchiseeQuery: '/franchisee/query',
  custMagerQuery: '/custMager/query',
  addFranchisee: '/franchisee/add',
  updateFranchisee: '/franchisee/modify',
  franchiseeDtl: '/franchisee/detail',
  editFranchiseeStatus: '/franchisee/modify/status',
  addCustMager: '/custMager/add',
  updateCustMager: '/custMager/modify',
  custMagerDtl: '/custMager/detail',
  delCustMager: '/custMager/remove',
  editCustMagerStatus: '/custMager/modify/status'
}

/**
 * franchiseeQuery func
 * parameter: {
 *     pageNum: '',
 *     pageSize: '',
 *     franchiseeKeyword: '',
 *     contactKeyword: '',
 *     status：''
 * }
 * @param parameter
 * @returns {*}
 */
export function getFranchiseeList (parameter) {
  return request({
    url: api.franchiseeQuery,
    method: 'post',
    data: parameter
  })
}

/**
 * roleQuery func
 * parameter: {
 *     pageNum: '',
 *     pageSize: '',
 *     userKeyword: '',
 *     franchiseeName: '',
 *     status：''
 * }
 * @param parameter
 * @returns {*}
 */
export function getCustMagerList (parameter) {
  return request({
    url: api.custMagerQuery,
    method: 'post',
    data: parameter
  })
}
/**
 * addFranchisee func
 * parameter: {
 *     franchiseeName: '',
 *     contactName:'',
 *     contactMobile:'',
 *     contactIdCard:'',
 *     pics:''
 * }
 * @param parameter
 * @returns {*}
 */
export function addFranchisee (parameter) {
  return request({
    url: api.addFranchisee,
    method: 'post',
    data: parameter
  })
}

/**
 * updateFranchisee func
 * parameter: {
 *     franchiseeId:'',
 *     franchiseeName: '',
 *     contactName:'',
 *     contactMobile:'',
 *     contactIdCard:'',
 *     pics:''
 * }
 * @param parameter
 * @returns {*}
 */
export function updateFranchisee (parameter) {
  return request({
    url: api.updateFranchisee,
    method: 'post',
    data: parameter
  })
}

/**
* franchiseeDtl func
* parameter: {
*     franchiseeId: '',
* }
* @param parameter
* @returns {*}
*/
export function getFranchiseeDtl (parameter) {
  return request({
    url: api.franchiseeDtl,
    method: 'post',
    data: parameter
  })
}

/**
* editFranchiseeStatus func
* parameter: {
*    status:'',
*    freezingReason:'',
*    franchiseeList:[ franchiseeId: '']
* }
* @param parameter
* @returns {*}
*/
export function editFranchiseeStatus (parameter) {
  return request({
    url: api.editFranchiseeStatus,
    method: 'post',
    data: parameter
  })
}

/**
 * addCustMager func
 * parameter: {
 *     franchiseeId:'',
 *     userName: '',
 *     userMobile:'',
 *     userTitle:'',
 *     wechat:'',
 *     qrCode:'',
 *     introduce:'',
 *     logoUrl''
 * }
 * @param parameter
 * @returns {*}
 */
export function addCustMager (parameter) {
  return request({
    url: api.addCustMager,
    method: 'post',
    data: parameter
  })
}

/**
 * updateCustMager func
 * parameter: {
 *     custMagerId:'',
 *     franchiseeId:'',
 *     userName: '',
 *     userMobile:'',
 *     userTitle:'',
 *     wechat:'',
 *     qrCode:'',
 *     introduce:'',
 *     logoUrl''
 * }
 * @param parameter
 * @returns {*}
 */
export function updateCustMager (parameter) {
  return request({
    url: api.updateCustMager,
    method: 'post',
    data: parameter
  })
}

/**
* custMagerDtl func
* parameter: {
*     custMagerId: '',
* }
* @param parameter
* @returns {*}
*/
export function getCustMagerDtl (parameter) {
  return request({
    url: api.custMagerDtl,
    method: 'post',
    data: parameter
  })
}

/**
* delCustMager func
* parameter: {
*     custMagerList:[{custMagerId: ''}],
* }
* @param parameter
* @returns {*}
*/
export function delCustMager (parameter) {
  return request({
    url: api.delCustMager,
    method: 'post',
    data: parameter
  })
}

/**
* editCustMagerStatus func
* parameter: {
*    status:'',
*    custMagerList:[ custMagerId: '']
* }
* @param parameter
* @returns {*}
*/
export function editCustMagerStatus (parameter) {
  return request({
    url: api.editCustMagerStatus,
    method: 'post',
    data: parameter
  })
}
